﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.Design;
using System.Drawing.Design;
using System.ComponentModel;
using ProjectN.Core.Element.Def;
using System.Drawing;

namespace ProjectN.Core.Fore.Editor
{
    class FontInfo_EditorDEF(): FontEditor
    {
        public override object? EditValue(ITypeDescriptorContext? context, IServiceProvider provider, object? value)
        {
            if (value is not FontInfo fntinfo)
                return value;
            if (base.EditValue(context, provider, fntinfo.Create()) is not Font fnt)
                return value;
            return new FontInfo { FamilyName = fnt.FontFamily.Name, Size = fnt.Size, Style = fnt.Style };
        }
    }
}
